﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows;

namespace AlbumArtOrganizer.UI
{
    public class OptionDataTemplateSelector : DataTemplateSelector
    {
        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            var window = Application.Current.MainWindow;

            if (item != null && item is AlbumArtOrganizer.Model.OptionString)
            {
                return window.FindResource("datatemplateOptionString") as DataTemplate;
            }
            if (item != null && item is AlbumArtOrganizer.Model.OptionDirectory)
            {
                return window.FindResource("datatemplateOptionDirectory") as DataTemplate;
            }
            if (item != null && item is AlbumArtOrganizer.Model.OptionEnumeration)
            {
                return window.FindResource("datatemplateOptionEnumeration") as DataTemplate;
            }

            return null;
        }
    }
}
